using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - DomainName Builder  --**********************
//--Created By: trooks
//--Description: DomainName Builder Class
//--Created Date: 03/07/2013 10:49:19
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class DomainName_Builder : IDomainName_builder 
	{
		
	public List<IDomainName_biz> BuildParts (IDomainName_biz _param)
	{
			IDomainName_biz temp = new DomainName_biz();
			IDomainNameController cont = new DomainNameController();
			List<IDomainName_biz> tempList = new List<IDomainName_biz>();
			List<IDomainName> tempData = new List<IDomainName>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = DomainNameTranslator.TranslateFromDataLayer(cont.DomainName_GetOne(DomainNameTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.DomainName_GetAll(DomainNameTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => DomainNameTranslator.TranslateFromDataLayer(p)).Cast<IDomainName_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IDomainName_biz> BuildParts (IDomainNameSearch_biz _param)
	{
			IDomainName_biz temp = new DomainName_biz();
			IDomainNameController cont = new DomainNameController();
			List<IDomainName_biz> tempList = new List<IDomainName_biz>();
			List<IDomainName> tempData = new List<IDomainName>();
			tempData = cont.DomainName_Search(DomainNameTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => DomainNameTranslator.TranslateFromDataLayer(p)).Cast<IDomainName_biz>().ToList();
			return tempList;

	}
		
	}
}
